package com.yubest.junit.asn1;

import lombok.Data;
import org.bouncycastle.asn1.*;
import org.bouncycastle.asn1.x509.Time;

/**
 * bean
 *
 * @Author: hweiyu
 * @Date: 2022/11/2 14:40
 */
@Data
public class Asn1Bean extends ASN1Object {

    private ASN1Integer id;

    private DERUTF8String name;

    private ASN1Integer age;

    private Time createDate;

    @Override
    public ASN1Primitive toASN1Primitive() {
        ASN1EncodableVector vector = new ASN1EncodableVector();
        vector.add(id);
        vector.add(name);
        vector.add(age);
        vector.add(createDate);
        return new DERSequence(vector);
    }
}
